package com.luhuiguo.cms.client;

import com.google.inject.Inject;
import com.luhuiguo.gwt.validation.client.i18n.ValidationMessages;

public class AppValidationMessages extends ValidationMessages {

    private AppConstants constants;

    @SuppressWarnings("unused")
    private AppMessages messages;

    public AppValidationMessages() {
        super();
    }

    @Inject
    public AppValidationMessages(AppConstants constants, AppMessages messages) {
        super(messages);
        this.constants = constants;
        this.messages = messages;

    }

    @Override
    public String getDescriptionMessage(String msgKey) {
        return constants.getString(msgKey);
    }

    @Override
    public String getCustomMessage(String key, Object... parameters) {
        return constants.getString(key);
    }

    @Override
    public String getPropertyName(String propertyName) {
        return constants.getString(propertyName);
    }

}
